package ma.cdm.compteRendu.bo;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;

/**
 * Suivipoint entity. @author Limouri Anouar
 */
@Entity
@Table(name="suivipoint")

public class SuiviPoint  implements java.io.Serializable {

	// Fields

     private Long id;
     private CompteRendu compteRendu;
     private Point point;
     private String presentepar;
     private Set<DetailPoint> detailPoints = new HashSet<DetailPoint>(0);

	// Constructors

    /** default constructor */
    public SuiviPoint() {
    }

	/** minimal constructor */
    public SuiviPoint(CompteRendu compteRendu, Point point) {
        this.compteRendu = compteRendu;
        this.point = point;
    }
    
    /** full constructor */
    public SuiviPoint(CompteRendu compteRendu, Point point, String presentepar, Set<DetailPoint> detailPoints) {
        this.compteRendu = compteRendu;
        this.point = point;
        this.presentepar = presentepar;
        this.detailPoints = detailPoints;
    }

   
    // Property accessors
    @GenericGenerator(name="generator", strategy="increment")@Id @GeneratedValue(generator="generator")
    
    @Column(name="ID", unique=true, nullable=false)

    public Long getId() {
        return this.id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
	@ManyToOne(fetch=FetchType.LAZY)
        @JoinColumn(name="IDCOMPTERENDU", nullable=false)

    public CompteRendu getCompteRendu() {
        return this.compteRendu;
    }
    
    public void setCompteRendu(CompteRendu compteRendu) {
        this.compteRendu = compteRendu;
    }
	@ManyToOne(fetch=FetchType.EAGER)
        @JoinColumn(name="IDPOINT", nullable=false)

    public Point getPoint() {
        return this.point;
    }
    
    public void setPoint(Point point) {
        this.point = point;
    }
    
    @Column(name="PRESENTEPAR", length=10)

    public String getPresentepar() {
        return this.presentepar;
    }
    
    public void setPresentepar(String presentepar) {
        this.presentepar = presentepar;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="suivipoint")

    public Set<DetailPoint> getDetailPoints() {
        return this.detailPoints;
    }
    
    public void setDetailPoints(Set<DetailPoint> detailPoints) {
        this.detailPoints = detailPoints;
    }
   

}